package uk.co.q3c.deplan.client.ui.command;

import uk.co.q3c.deplan.client.Orchestrator;
import uk.co.q3c.deplan.client.domain.task.BaseTask;
import uk.co.q3c.deplan.client.ui.view.ViewManager;
import uk.co.q3c.deplan.client.ui.view.Viewtags;

import com.google.gwt.user.client.Command;

/**
 * Creates a new {@link Project} instance, and passes it to the {@link ViewManager}
 * 
 * @author dsowerby
 * 
 */
public class NewProjectCommand implements Command {

	@Override
	public void execute() {
		BaseTask newProject = new BaseTask(Orchestrator.serviceFactory());
		Orchestrator.screenView()
				.getPresenter()
				.changeViewTo(Viewtags.ProjectView);
		Orchestrator.setObjectInView(newProject);

	}

}
